import request, { service, sseConfig } from '@/utils/request'

// 声明基本路径
let basePath = window.location.pathname.includes('test') ? '/wydc/' : '/wydc/'


export function postQuery(params) {
    return request({
        url: basePath + 'intv/post/query',
        method: 'get',
        params
    })
}
export function industryQuery(data) {
    return request({
        url: basePath + 'intv/industry/query',
        method: 'get',
        data
    })
}
export function phoneLogin(data) {
    return request({
        url: basePath + 'intv/login/phoneLogin',
        method: 'post',
        data
    })
}

export function resumeUpload(data) {
    return request({
        url: basePath + 'intv/resume/upload',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}
export function resumeQuery(data) {
    return request({
        url: basePath + 'intv/resume/query',
        method: 'get',
        data
    })
}

export function resumeDelete(resumeId) {
    return request({
        url: basePath + `intv/resume/${resumeId}`,
        method: 'delete'
    })
}
export function interviewStart(data) {
    return request({
        url: basePath + `intv/interview/start`,
        method: 'post',
        data
    })
}

export function interviewStartAnswer(params) {
    return request({
        url: basePath + `intv/interview/startAnswer`,
        method: 'get',
        params
    })
}

export function startAnswer(params) {
    return request({
        url: basePath + `intv/interview/startAnswer`,
        method: 'get',
        params
    })
}

export function replyAnswer(data) {
    return request({
        url: basePath + `intv/interview/replyAnswer`,
        method: 'post',
        data
    })
}

export function endInterview(params) {
    return request({
        url: basePath + `intv/interview/endInterview`,
        method: 'get',
        params
    })
}

export function queryRecord(data) {
    return request({
        url: basePath + `intv/interview/queryRecord`,
        method: 'post',
        data
    })
}

export function toggleCollect(data) {
    return request({
        url: basePath + `intv/interview/toggleCollect`,
        method: 'post',
        data
    })
}

export function interviewDelete(interviewId) {
    return request({
        url: basePath + `intv/interview/${interviewId}`,
        method: 'DELETE',
    })
}

export function interviewDetail(params) {
    return request({
        url: basePath + `intv/interview/detail`,
        method: 'get',
        params
    })
}

export function questionQuery(data) {
    return request({
        url: basePath + `intv/question/query`,
        method: 'post',
        data
    })
}


export function questionToggleCollect(data) {
    return request({
        url: basePath + `intv/question/toggleCollect`,
        method: 'post',
        data
    })
}

export function questionDelete(data) {
    return request({
        url: basePath + `intv/question/${data.dialogId}`,
        method: 'get',
        params: data
    })
}

export function resumeAnalysis(resumeId) {
    return request({
        url: basePath + `intv/resume/analysis/${resumeId}`,
        method: 'get',
    })
}